﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UMO
{
    public enum UmoNodeType{file,url,folder,start};
    public class UmoNode
    {
        public UmoNodeType NodeType { get; set; }
        public int Index { get; set; }
        public int ParentIndex { get; set; }
        public int RelationIndex { get; set; }
        public string Value { get; set; }
        private static ArgumentException INCORRECT_INIT_PARAMS = new ArgumentException("Некоректни данни за инициализирането на точка от графата.");
        public UmoNode(UmoNodeType nodeType,string value,int index,int parentIndex=-1,int relIndex=-1)
        {
            this.NodeType = nodeType;
            if (value == String.Empty || value == null)
            {
                throw INCORRECT_INIT_PARAMS;
            }
            this.Value = value;
            this.Index = index;
            if (index == parentIndex || index == relIndex)
            {
                throw INCORRECT_INIT_PARAMS;
            }
            this.ParentIndex = parentIndex;
            this.RelationIndex = relIndex;
        }
    }
}
